package storage.file;


public class BlockID {

	private String fileName;
	private int offset;
	
    public BlockID(String fileName, int offset) {
		this.fileName = fileName;
		this.offset = offset;
	}
	
	public String fileName() { return fileName; }
	
	public int offset() { return offset; }
	public boolean equals(Object obj) {
	      BlockID blockID = (BlockID) obj;
	      return fileName.equals(blockID.fileName) && offset == blockID.offset;
	   }
	   
	   public String toString() {
	      return "[file " + fileName + ", block " + offset + "]";
	   }
	   
	   public int hashCode() {
	      return toString().hashCode();
	   }
}
